<?php

// No need to include the library twice, even accidentally.
if (defined('CLIDIR'))
{
	return;
}

define('CLIDIR', dirname(__FILE__));

require CLIDIR . '/exceptions.php';

// Include interfaces
require CLIDIR . '/interfaces/ExecutableStmt.iface.php';
require CLIDIR . '/interfaces/CliLibrary.iface.php';
require CLIDIR . '/interfaces/ModeHandler.iface.php';
require CLIDIR . '/interfaces/ExpCall.iface.php';
require CLIDIR . '/interfaces/ExpValue.iface.php';
require CLIDIR . '/interfaces/ExpNumber.iface.php';
require CLIDIR . '/interfaces/ExpModeNumber.iface.php';

// Include classes of the WCC execution layer
require CLIDIR . '/CliCalc.class.php';
require CLIDIR . '/CliLib.class.php';
require CLIDIR . '/CliMode.class.php';
require CLIDIR . '/CliContext.class.php';
require CLIDIR . '/ArgContext.class.php';
require CLIDIR . '/CliParser.class.php';
require CLIDIR . '/CommandStmt.class.php';
require CLIDIR . '/ExpressionStmt.class.php';
require CLIDIR . '/ExpVariable.class.php';
require CLIDIR . '/ExpOperator.class.php';
require CLIDIR . '/ExpFunction.class.php';
require CLIDIR . '/ExpUserfunc.class.php';
require CLIDIR . '/ExpBind.class.php';
require CLIDIR . '/StackTerminator.class.php';

// Operator precedence groups
$cli_precedence = array(
	'null',
	'assignment',
	'ternary',
	'logicor',
	'logicxor',
	'logicand',
	'binaryor',
	'binaryxor',
	'binaryand',
	'eqneq',
	'ltgt',
	'shift',
	'sum',
	'term',
	'power',
	'prefix',
	'postfix',
	'array',
);

$prec = 1;

foreach ($cli_precedence as $name)
{
	define('PREC_' . strtoupper($name), $prec++);
}

?>